home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue61 / Clinic / HintEg1U.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-06-28  |  1.1 KB  |  54 lines

  1. unit HintEg1U;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ComCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     StatusBar1: TStatusBar;
  12.     Edit1: TEdit;
  13.     Button1: TButton;
  14.     CheckBox1: TCheckBox;
  15.     Label1: TLabel;
  16.     Memo1: TMemo;
  17.     RadioButton1: TRadioButton;
  18.     chkSimpleText: TCheckBox;
  19.     procedure FormCreate(Sender: TObject);
  20.     procedure chkSimpleTextClick(Sender: TObject);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     procedure AppHint(Sender: TObject);
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. procedure TForm1.AppHint(Sender: TObject);
  35. begin
  36.   { Write current component hint on status bar }
  37.   if StatusBar1.SimplePanel or (StatusBar1.Panels.Count = 0) then
  38.     StatusBar1.SimpleText := Application.Hint
  39.   else
  40.     StatusBar1.Panels[0].Text := Application.Hint
  41. end;
  42.  
  43. procedure TForm1.FormCreate(Sender: TObject);
  44. begin
  45.   Application.OnHint := AppHint
  46. end;
  47.  
  48. procedure TForm1.chkSimpleTextClick(Sender: TObject);
  49. begin
  50.   StatusBar1.SimplePanel := chkSimpleText.Checked
  51. end;
  52.  
  53. end.
  54.